package com.blate.dogxiao;

import android.content.Context;
import android.content.res.AssetManager;

import com.blate.dogxiao.bean.UserBean;
import com.google.gson.Gson;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * @author Blate
 * Created in 2021/4/21
 */
public class Repo {

    public static UserBean getSelfBean(Context context) throws IOException {
        AssetManager assetManager = context.getAssets();
        try (InputStream inputStream = assetManager.open("self.json")) {
            return new Gson().fromJson(new InputStreamReader(inputStream), UserBean.class);
        }
    }

}
